package com.redijedi.tapestry.components;

import org.apache.tapestry.Block;
import org.apache.tapestry.ComponentResources;
import org.apache.tapestry.MarkupWriter;
import org.apache.tapestry.annotations.AfterRenderBody;
import org.apache.tapestry.annotations.BeforeRenderBody;
import org.apache.tapestry.annotations.Inject;
import org.apache.tapestry.annotations.Parameter;
import org.apache.tapestry.annotations.SetupRender;
import org.apache.tapestry.dom.Element;
import org.apache.tapestry.ioc.services.PropertyAccess;
import org.apache.tapestry.services.Environment;

/**
 * Allows blocks of content to be inserted into the <code>&lt;head&gt;</code>
 * of the HTML page.
 * 
 * @author torr
 * 
 */
public class HtmlHead {

	@Inject
	private Environment _environment;

	@Inject
	private ComponentResources _resources;
	
	@Parameter
	private Block _content;

	@BeforeRenderBody
	boolean before(MarkupWriter writer) {
		Element head = writer.getDocument().find("html/head");
		Element c = writer.getElement();
		
		// List<?> elements = block.addToBody(head.);
		return true;
	}

	@AfterRenderBody
	boolean after(MarkupWriter writer) {
		Element head = writer.getDocument().find("html/head");
		Element c = writer.getElement();
		
		
		
		// List<?> elements = block.addToBody(head.);
		return true;
	}

}
